#include"Log.hpp"
#include"ThreadPool.hpp"
#include<memory>
#include"Task.hpp"

using namespace LogModule;
using namespace ThreadPoolModule;

int main()
{
    Enable_Console_Log_Strategy();
    
   int count = 10;
   while(count)
   {
        sleep(1);
        ThreadPool<task_t>::GetInstance()->Enqueue(Download);
        count--;
   }

   ThreadPool<task_t>::GetInstance()->Stop();
   ThreadPool<task_t>::GetInstance()->Join();

   //Enable_File_Log_Strategy();
    // LOG(LogLevel::DEBUG)<<"hello world"<<3.141;
    // LOG(LogLevel::DEBUG)<<"hello world"<<3.1412;

    Enable_Console_Log_Strategy();
    LOG(LogLevel::INFO)<<"hello world"<<3.14123;
    LOG(LogLevel::INFO)<<"hello world"<<3.1411;

    std::unique_ptr<LogStrategy> strategy = std::make_unique<ConsoleLogStrategy>();
    strategy->Synclog("hello log!");
    logger(LogLevel::DEBUG,"main.cc",10)<<"hello ji"<<9090<<"aaaa";

    return 0;
}